//
//	ZcoModelSession.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "ZcoModelSession.h"

NSString *const kZcoModelSessionBizScenarioId = @"bizScenarioId";
NSString *const kZcoModelSessionGroup = @"group";
NSString *const kZcoModelSessionIdField = @"id";
NSString *const kZcoModelSessionRoom = @"room";
NSString *const kZcoModelSessionUrl = @"url";

@interface ZcoModelSession ()
@end
@implementation ZcoModelSession




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kZcoModelSessionBizScenarioId] isKindOfClass:[NSNull class]]){
		self.bizScenarioId = dictionary[kZcoModelSessionBizScenarioId];
	}	
	if(![dictionary[kZcoModelSessionGroup] isKindOfClass:[NSNull class]]){
		self.group = dictionary[kZcoModelSessionGroup];
	}	
	if(![dictionary[kZcoModelSessionIdField] isKindOfClass:[NSNull class]]){
		self.idField = dictionary[kZcoModelSessionIdField];
	}	
	if(![dictionary[kZcoModelSessionRoom] isKindOfClass:[NSNull class]]){
		self.room = dictionary[kZcoModelSessionRoom];
	}	
	if(![dictionary[kZcoModelSessionUrl] isKindOfClass:[NSNull class]]){
		self.url = [[ZcoModelUrl alloc] initWithDictionary:dictionary[kZcoModelSessionUrl]];
	}

	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	if(self.bizScenarioId != nil){
		dictionary[kZcoModelSessionBizScenarioId] = self.bizScenarioId;
	}
	if(self.group != nil){
		dictionary[kZcoModelSessionGroup] = self.group;
	}
	if(self.idField != nil){
		dictionary[kZcoModelSessionIdField] = self.idField;
	}
	if(self.room != nil){
		dictionary[kZcoModelSessionRoom] = self.room;
	}
	if(self.url != nil){
		dictionary[kZcoModelSessionUrl] = [self.url toDictionary];
	}
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	if(self.bizScenarioId != nil){
		[aCoder encodeObject:self.bizScenarioId forKey:kZcoModelSessionBizScenarioId];
	}
	if(self.group != nil){
		[aCoder encodeObject:self.group forKey:kZcoModelSessionGroup];
	}
	if(self.idField != nil){
		[aCoder encodeObject:self.idField forKey:kZcoModelSessionIdField];
	}
	if(self.room != nil){
		[aCoder encodeObject:self.room forKey:kZcoModelSessionRoom];
	}
	if(self.url != nil){
		[aCoder encodeObject:self.url forKey:kZcoModelSessionUrl];
	}

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.bizScenarioId = [aDecoder decodeObjectForKey:kZcoModelSessionBizScenarioId];
	self.group = [aDecoder decodeObjectForKey:kZcoModelSessionGroup];
	self.idField = [aDecoder decodeObjectForKey:kZcoModelSessionIdField];
	self.room = [aDecoder decodeObjectForKey:kZcoModelSessionRoom];
	self.url = [aDecoder decodeObjectForKey:kZcoModelSessionUrl];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	ZcoModelSession *copy = [ZcoModelSession new];

	copy.bizScenarioId = [self.bizScenarioId copy];
	copy.group = [self.group copy];
	copy.idField = [self.idField copy];
	copy.room = [self.room copy];
	copy.url = [self.url copy];

	return copy;
}
@end